import re

q = "http://www.interoem.com/messageinfo.asp?id=35"

data = re.sub(r"(http://.+?/).*",lambda x:x.group(1),q)
print(data)